<template>
  <!-- <div class="box1" @click="handleClickFn1">
        <p>我是子组件</p>
  </div> -->
  <!-- 使用的孙子组件 -->
   <Grandson></Grandson>

   <!--  -->
   <p>child:{{ $attrs.username }}</p>
</template>

<script>
import Grandson from './Grandson.vue';

  export default {
    name:'',
    data () {
      return {

      };
    },
    props:['username'],
    //inheritAttrs: false, // 禁止传递透传
    created() {
        console.log('child-this',this);    
    },
    methods: {
        handleClickFn1() {
            console.log('事件2');
        }
    },
    components: {
        Grandson
    }


  }

</script>
<style scoped>
p{
  background: deeppink;
}
</style>